﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace homeworkhero
{
    class Projectile : CollidableSprite
    {
        public Projectile(Stage s, Vector2 initialPosition, Vector2 initialVelocity, AnimationSet animSet)
            : base(s, CollidableSprite.CollidableSpriteType.BULLET, animSet)
        {
            base.setPosition(initialPosition);
            base.setVelocity(initialVelocity);
        }
        public override int getDamage()
        {
            return 5;
        }

        public override Vector2 getScreenPosition() {
            Vector2 realPos = getPosition();

            // calculate x position based on stage stuff
            realPos.X = (Game1.SCREENWIDTH / 3.0f) - stage.getPlayerX() + realPos.X + 70.0f;
            realPos.Y = Game1.SCREENHEIGHT - (realPos.Y * Game1.LAYERHEIGHT) - 68.0f;

            if (realPos.X > Game1.SCREENWIDTH)
                this.destroy();

            return realPos;
        }

    }
}
